<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Lookup API reference &mdash; Django 1.7.8.dev20150401230226 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.7.8.dev20150401230226',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="Django 1.7.8.dev20150401230226 documentation" href="../../index.html" />
    <link rel="up" title="Models" href="index.html" />
    <link rel="next" title="Request and response objects" href="../request-response.html" />
    <link rel="prev" title="Query-related classes" href="queries.html" />



 
<script type="text/javascript" src="../../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);
</script>


  </head>
  <body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../../index.html">Django 1.7.8.dev20150401230226 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../../index.html">Home</a>  |
        <a title="Table of contents" href="../../contents.html">Table of contents</a>  |
        <a title="Global index" href="../../genindex.html">Index</a>  |
        <a title="Module index" href="../../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="queries.html" title="Query-related classes">previous</a>
     |
    <a href="../index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="../request-response.html" title="Request and response objects">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="ref-models-lookups">
            
  <div class="section" id="s-module-django.db.models.lookups">
<span id="s-lookup-api-reference"></span><span id="module-django.db.models.lookups"></span><span id="lookup-api-reference"></span><h1>Lookup API reference<a class="headerlink" href="#module-django.db.models.lookups" title="Permalink to this headline">¶</a></h1>
<div class="versionadded">
<span class="title">New in Django 1.7.</span> </div>
<p>This document has the API references of lookups, the Django API for building
the <tt class="docutils literal"><span class="pre">WHERE</span></tt> clause of a database query. To learn how to <em>use</em> lookups, see
<a class="reference internal" href="../../topics/db/queries.html"><em>Making queries</em></a>; to learn how to <em>create</em> new lookups, see
<a class="reference internal" href="../../howto/custom-lookups.html"><em>Custom Lookups</em></a>.</p>
<p>The lookup API has two components: a <a class="reference internal" href="#django.db.models.lookups.RegisterLookupMixin" title="django.db.models.lookups.RegisterLookupMixin"><tt class="xref py py-class docutils literal"><span class="pre">RegisterLookupMixin</span></tt></a> class
that registers lookups, and the <a class="reference internal" href="#query-expression"><em>Query Expression API</em></a>, a
set of methods that a class has to implement to be registrable as a lookup.</p>
<p>Django has two base classes that follow the query expression API and from where
all Django builtin lookups are derived:</p>
<ul class="simple">
<li><a class="reference internal" href="#django.db.models.Lookup" title="django.db.models.Lookup"><tt class="xref py py-class docutils literal"><span class="pre">Lookup</span></tt></a>: to lookup a field (e.g. the <tt class="docutils literal"><span class="pre">exact</span></tt> of <tt class="docutils literal"><span class="pre">field_name__exact</span></tt>)</li>
<li><a class="reference internal" href="#django.db.models.Transform" title="django.db.models.Transform"><tt class="xref py py-class docutils literal"><span class="pre">Transform</span></tt></a>: to transform a field</li>
</ul>
<p>A lookup expression consists of three parts:</p>
<ul class="simple">
<li>Fields part (e.g. <tt class="docutils literal"><span class="pre">Book.objects.filter(author__best_friends__first_name...</span></tt>);</li>
<li>Transforms part (may be omitted) (e.g. <tt class="docutils literal"><span class="pre">__lower__first3chars__reversed</span></tt>);</li>
<li>A lookup (e.g. <tt class="docutils literal"><span class="pre">__icontains</span></tt>) that, if omitted, defaults to <tt class="docutils literal"><span class="pre">__exact</span></tt>.</li>
</ul>
<div class="section" id="s-registration-api">
<span id="s-lookup-registration-api"></span><span id="registration-api"></span><span id="lookup-registration-api"></span><h2>Registration API<a class="headerlink" href="#registration-api" title="Permalink to this headline">¶</a></h2>
<p>Django uses <a class="reference internal" href="#django.db.models.lookups.RegisterLookupMixin" title="django.db.models.lookups.RegisterLookupMixin"><tt class="xref py py-class docutils literal"><span class="pre">RegisterLookupMixin</span></tt></a> to give a class the interface to
register lookups on itself. The two prominent examples are
<a class="reference internal" href="fields.html#django.db.models.Field" title="django.db.models.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a>, the base class of all model fields, and
<tt class="docutils literal"><span class="pre">Aggregate</span></tt>, the base class of all Django aggregates.</p>
<dl class="class">
<dt id="django.db.models.lookups.RegisterLookupMixin">
<em class="property">class </em><tt class="descclassname">lookups.</tt><tt class="descname">RegisterLookupMixin</tt><a class="headerlink" href="#django.db.models.lookups.RegisterLookupMixin" title="Permalink to this definition">¶</a></dt>
<dd><p>A mixin that implements the lookup API on a class.</p>
<dl class="classmethod">
<dt id="django.db.models.lookups.RegisterLookupMixin.register_lookup">
<em class="property">classmethod </em><tt class="descname">register_lookup</tt>(<em>lookup</em>)<a class="headerlink" href="#django.db.models.lookups.RegisterLookupMixin.register_lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a new lookup in the class. For example
<tt class="docutils literal"><span class="pre">DateField.register_lookup(YearExact)</span></tt> will register <tt class="docutils literal"><span class="pre">YearExact</span></tt>
lookup on <tt class="docutils literal"><span class="pre">DateField</span></tt>. It overrides a lookup that already exists with
the same name.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.lookups.RegisterLookupMixin.get_lookup">
<tt class="descname">get_lookup</tt>(<em>lookup_name</em>)<a class="headerlink" href="#django.db.models.lookups.RegisterLookupMixin.get_lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the <a class="reference internal" href="#django.db.models.Lookup" title="django.db.models.Lookup"><tt class="xref py py-class docutils literal"><span class="pre">Lookup</span></tt></a> named <tt class="docutils literal"><span class="pre">lookup_name</span></tt> registered in the class.
The default implementation looks recursively on all parent classes
and checks if any has a registered lookup named <tt class="docutils literal"><span class="pre">lookup_name</span></tt>, returning
the first match.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.lookups.RegisterLookupMixin.get_transform">
<tt class="descname">get_transform</tt>(<em>transform_name</em>)<a class="headerlink" href="#django.db.models.lookups.RegisterLookupMixin.get_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <a class="reference internal" href="#django.db.models.Transform" title="django.db.models.Transform"><tt class="xref py py-class docutils literal"><span class="pre">Transform</span></tt></a> named <tt class="docutils literal"><span class="pre">transform_name</span></tt>. The default
implementation looks recursively on all parent classes to check if any
has the registered transform named <tt class="docutils literal"><span class="pre">transform_name</span></tt>, returning the first
match.</p>
</dd></dl>

</dd></dl>

<p>For a class to be a lookup, it must follow the <a class="reference internal" href="#query-expression"><em>Query Expression API</em></a>. <a class="reference internal" href="#django.db.models.Lookup" title="django.db.models.Lookup"><tt class="xref py py-class docutils literal"><span class="pre">Lookup</span></tt></a> and <a class="reference internal" href="#django.db.models.Transform" title="django.db.models.Transform"><tt class="xref py py-class docutils literal"><span class="pre">Transform</span></tt></a> naturally
follow this API.</p>
</div>
<div class="section" id="s-the-query-expression-api">
<span id="s-query-expression"></span><span id="the-query-expression-api"></span><span id="query-expression"></span><h2>The Query Expression API<a class="headerlink" href="#the-query-expression-api" title="Permalink to this headline">¶</a></h2>
<p>The query expression API is a common set of methods that classes define to be
usable in query expressions to translate themselves into SQL expressions. Direct
field references, aggregates, and <tt class="docutils literal"><span class="pre">Transform</span></tt> are examples that follow this
API. A class is said to follow the query expression API when it implements the
following methods:</p>
<dl class="method">
<dt id="django.db.models.as_sql">
<tt class="descname">as_sql</tt>(<em>self</em>, <em>qn</em>, <em>connection</em>)<a class="headerlink" href="#django.db.models.as_sql" title="Permalink to this definition">¶</a></dt>
<dd><p>Responsible for producing the query string and parameters for the expression.
The <tt class="docutils literal"><span class="pre">qn</span></tt> is an <tt class="docutils literal"><span class="pre">SQLCompiler</span></tt> object, which has a <tt class="docutils literal"><span class="pre">compile()</span></tt> method
that can be used to compile other expressions. The <tt class="docutils literal"><span class="pre">connection</span></tt> is the
connection used to execute the query.</p>
<p>Calling <tt class="docutils literal"><span class="pre">expression.as_sql()</span></tt> is usually incorrect - instead
<tt class="docutils literal"><span class="pre">qn.compile(expression)</span></tt> should be used. The <tt class="docutils literal"><span class="pre">qn.compile()</span></tt> method will
take care of calling vendor-specific methods of the expression.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.as_vendorname">
<tt class="descname">as_vendorname</tt>(<em>self</em>, <em>qn</em>, <em>connection</em>)<a class="headerlink" href="#django.db.models.as_vendorname" title="Permalink to this definition">¶</a></dt>
<dd><p>Works like <tt class="docutils literal"><span class="pre">as_sql()</span></tt> method. When an expression is compiled by
<tt class="docutils literal"><span class="pre">qn.compile()</span></tt>, Django will first try to call <tt class="docutils literal"><span class="pre">as_vendorname()</span></tt>, where
<tt class="docutils literal"><span class="pre">vendorname</span></tt> is the vendor name of the backend used for executing the
query. The <tt class="docutils literal"><span class="pre">vendorname</span></tt> is one of <tt class="docutils literal"><span class="pre">postgresql</span></tt>, <tt class="docutils literal"><span class="pre">oracle</span></tt>, <tt class="docutils literal"><span class="pre">sqlite</span></tt>,
or <tt class="docutils literal"><span class="pre">mysql</span></tt> for Django&#8217;s built-in backends.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.get_lookup">
<tt class="descname">get_lookup</tt>(<em>lookup_name</em>)<a class="headerlink" href="#django.db.models.get_lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Must return the lookup named <tt class="docutils literal"><span class="pre">lookup_name</span></tt>. For instance, by returning
<tt class="docutils literal"><span class="pre">self.output_field.get_lookup(lookup_name)</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.get_transform">
<tt class="descname">get_transform</tt>(<em>transform_name</em>)<a class="headerlink" href="#django.db.models.get_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Must return the lookup named <tt class="docutils literal"><span class="pre">transform_name</span></tt>. For instance, by returning
<tt class="docutils literal"><span class="pre">self.output_field.get_transform(transform_name)</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.db.models.output_field">
<tt class="descname">output_field</tt><a class="headerlink" href="#django.db.models.output_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Defines the type of class returned by the <tt class="docutils literal"><span class="pre">get_lookup()</span></tt> method. It must
be a <a class="reference internal" href="fields.html#django.db.models.Field" title="django.db.models.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> instance.</p>
</dd></dl>

</div>
<div class="section" id="s-transform-reference">
<span id="transform-reference"></span><h2>Transform reference<a class="headerlink" href="#transform-reference" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="django.db.models.Transform">
<em class="property">class </em><tt class="descname">Transform</tt><a class="headerlink" href="#django.db.models.Transform" title="Permalink to this definition">¶</a></dt>
<dd><p>A <tt class="docutils literal"><span class="pre">Transform</span></tt> is a generic class to implement field transformations. A
prominent example is <tt class="docutils literal"><span class="pre">__year</span></tt> that transforms a <tt class="docutils literal"><span class="pre">DateField</span></tt> into a
<tt class="docutils literal"><span class="pre">IntegerField</span></tt>.</p>
<p>The notation to use a <tt class="docutils literal"><span class="pre">Transform</span></tt> in an lookup expression is
<tt class="docutils literal"><span class="pre">&lt;expression&gt;__&lt;transformation&gt;</span></tt> (e.g. <tt class="docutils literal"><span class="pre">date__year</span></tt>).</p>
<p>This class follows the <a class="reference internal" href="#query-expression"><em>Query Expression API</em></a>, which
implies that you can use <tt class="docutils literal"><span class="pre">&lt;expression&gt;__&lt;transform1&gt;__&lt;transform2&gt;</span></tt>.</p>
<dl class="attribute">
<dt id="django.db.models.Transform.lhs">
<tt class="descname">lhs</tt><a class="headerlink" href="#django.db.models.Transform.lhs" title="Permalink to this definition">¶</a></dt>
<dd><p>The left-hand side - what is being transformed. It must follow the
<a class="reference internal" href="#query-expression"><em>Query Expression API</em></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.db.models.Transform.lookup_name">
<tt class="descname">lookup_name</tt><a class="headerlink" href="#django.db.models.Transform.lookup_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the lookup, used for identifying it on parsing query
expressions. It cannot contain the string <tt class="docutils literal"><span class="pre">&quot;__&quot;</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.db.models.Transform.output_field">
<tt class="descname">output_field</tt><a class="headerlink" href="#django.db.models.Transform.output_field" title="Permalink to this definition">¶</a></dt>
<dd><p>Defines the class this transformation outputs. It must be a
<a class="reference internal" href="fields.html#django.db.models.Field" title="django.db.models.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> instance. By default is the same as
its <tt class="docutils literal"><span class="pre">lhs.output_field</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.Transform.as_sql">
<tt class="descname">as_sql</tt>()<a class="headerlink" href="#django.db.models.Transform.as_sql" title="Permalink to this definition">¶</a></dt>
<dd><p>To be overridden; raises <a class="reference external" href="http://docs.python.org/3/library/exceptions.html#NotImplementedError" title="(in Python v3.4)"><tt class="xref py py-exc docutils literal"><span class="pre">NotImplementedError</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.Transform.get_lookup">
<tt class="descname">get_lookup</tt>(<em>lookup_name</em>)<a class="headerlink" href="#django.db.models.Transform.get_lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <a class="reference internal" href="#django.db.models.lookups.RegisterLookupMixin.get_lookup" title="django.db.models.lookups.RegisterLookupMixin.get_lookup"><tt class="xref py py-meth docutils literal"><span class="pre">get_lookup()</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.Transform.get_transform">
<tt class="descname">get_transform</tt>(<em>transform_name</em>)<a class="headerlink" href="#django.db.models.Transform.get_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <a class="reference internal" href="#django.db.models.lookups.RegisterLookupMixin.get_transform" title="django.db.models.lookups.RegisterLookupMixin.get_transform"><tt class="xref py py-meth docutils literal"><span class="pre">get_transform()</span></tt></a>.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="s-lookup-reference">
<span id="lookup-reference"></span><h2>Lookup reference<a class="headerlink" href="#lookup-reference" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="django.db.models.Lookup">
<em class="property">class </em><tt class="descname">Lookup</tt><a class="headerlink" href="#django.db.models.Lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>A <tt class="docutils literal"><span class="pre">Lookup</span></tt> is a generic class to implement lookups. A lookup is a query
expression with a left-hand side, <a class="reference internal" href="#django.db.models.Lookup.lhs" title="django.db.models.Lookup.lhs"><tt class="xref py py-attr docutils literal"><span class="pre">lhs</span></tt></a>; a right-hand side,
<a class="reference internal" href="#django.db.models.Lookup.rhs" title="django.db.models.Lookup.rhs"><tt class="xref py py-attr docutils literal"><span class="pre">rhs</span></tt></a>; and a <tt class="docutils literal"><span class="pre">lookup_name</span></tt> that is used to produce a boolean
comparison between <tt class="docutils literal"><span class="pre">lhs</span></tt> and <tt class="docutils literal"><span class="pre">rhs</span></tt> such as <tt class="docutils literal"><span class="pre">lhs</span> <span class="pre">in</span> <span class="pre">rhs</span></tt> or
<tt class="docutils literal"><span class="pre">lhs</span> <span class="pre">&gt;</span> <span class="pre">rhs</span></tt>.</p>
<p>The notation to use a lookup in an expression is
<tt class="docutils literal"><span class="pre">&lt;lhs&gt;__&lt;lookup_name&gt;=&lt;rhs&gt;</span></tt>.</p>
<p>This class doesn&#8217;t follow the <a class="reference internal" href="#query-expression"><em>Query Expression API</em></a>
since it has <tt class="docutils literal"><span class="pre">=&lt;rhs&gt;</span></tt> on its construction: lookups are always the end of
a lookup expression.</p>
<dl class="attribute">
<dt id="django.db.models.Lookup.lhs">
<tt class="descname">lhs</tt><a class="headerlink" href="#django.db.models.Lookup.lhs" title="Permalink to this definition">¶</a></dt>
<dd><p>The left-hand side - what is being looked up. The object must follow
the <a class="reference internal" href="#query-expression"><em>Query Expression API</em></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.db.models.Lookup.rhs">
<tt class="descname">rhs</tt><a class="headerlink" href="#django.db.models.Lookup.rhs" title="Permalink to this definition">¶</a></dt>
<dd><p>The right-hand side - what <tt class="docutils literal"><span class="pre">lhs</span></tt> is being compared against. It can be
a plain value, or something that compiles into SQL, typically an
<tt class="docutils literal"><span class="pre">F()</span></tt> object or a <tt class="docutils literal"><span class="pre">QuerySet</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="django.db.models.Lookup.lookup_name">
<tt class="descname">lookup_name</tt><a class="headerlink" href="#django.db.models.Lookup.lookup_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of this lookup, used to identify it on parsing query
expressions. It cannot contain the string <tt class="docutils literal"><span class="pre">&quot;__&quot;</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.Lookup.process_lhs">
<tt class="descname">process_lhs</tt>(<em>qn</em>, <em>connection</em><span class="optional">[</span>, <em>lhs=None</em><span class="optional">]</span>)<a class="headerlink" href="#django.db.models.Lookup.process_lhs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a tuple <tt class="docutils literal"><span class="pre">(lhs_string,</span> <span class="pre">lhs_params)</span></tt>, as returned by
<tt class="docutils literal"><span class="pre">qn.compile(lhs)</span></tt>. This method can be overridden to tune how the
<tt class="docutils literal"><span class="pre">lhs</span></tt> is processed.</p>
<p><tt class="docutils literal"><span class="pre">qn</span></tt> is an <tt class="docutils literal"><span class="pre">SQLCompiler</span></tt> object, to be used like <tt class="docutils literal"><span class="pre">qn.compile(lhs)</span></tt>
for compiling <tt class="docutils literal"><span class="pre">lhs</span></tt>. The <tt class="docutils literal"><span class="pre">connection</span></tt> can be used for compiling
vendor specific SQL. If <tt class="docutils literal"><span class="pre">lhs</span></tt> is not <tt class="docutils literal"><span class="pre">None</span></tt>, use it as the
processed <tt class="docutils literal"><span class="pre">lhs</span></tt> instead of <tt class="docutils literal"><span class="pre">self.lhs</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="django.db.models.Lookup.process_rhs">
<tt class="descname">process_rhs</tt>(<em>qn</em>, <em>connection</em>)<a class="headerlink" href="#django.db.models.Lookup.process_rhs" title="Permalink to this definition">¶</a></dt>
<dd><p>Behaves the same way as <a class="reference internal" href="#django.db.models.Lookup.process_lhs" title="django.db.models.Lookup.process_lhs"><tt class="xref py py-meth docutils literal"><span class="pre">process_lhs()</span></tt></a>, for the right-hand side.</p>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Lookup API reference</a><ul>
<li><a class="reference internal" href="#registration-api">Registration API</a></li>
<li><a class="reference internal" href="#the-query-expression-api">The Query Expression API</a></li>
<li><a class="reference internal" href="#transform-reference">Transform reference</a></li>
<li><a class="reference internal" href="#lookup-reference">Lookup reference</a></li>
</ul>
</li>
</ul>

  <h3>Browse</h3>
  <ul>
    
      <li>Prev: <a href="queries.html">Query-related classes</a></li>
    
    
      <li>Next: <a href="../request-response.html">Request and response objects</a></li>
    
  </ul>
  <h3>You are here:</h3>
  <ul>
      <li>
        <a href="../../index.html">Django 1.7.8.dev20150401230226 documentation</a>
        
          <ul><li><a href="../index.html">API Reference</a>
        
          <ul><li><a href="index.html">Models</a>
        
        <ul><li>Lookup API reference</li></ul>
        </li></ul></li></ul>
      </li>
  </ul>

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/ref/models/lookups.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Apr 02, 2015</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="queries.html" title="Query-related classes">previous</a>
     |
    <a href="../index.html" title="API Reference" accesskey="U">up</a>
   |
    <a href="../request-response.html" title="Request and response objects">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>